package com.lt.integration.jpa.component.hibernate.json;

import org.hibernate.type.AbstractSingleColumnStandardBasicType;
import org.hibernate.usertype.DynamicParameterizedType;

import java.util.Properties;

/**
 * 对hibernate的annotation扩展 支持json格式
 * @author weidian
 *
 */
public class JsonListType extends AbstractSingleColumnStandardBasicType<Object> implements DynamicParameterizedType  {
	
	private static final long serialVersionUID = 8395965601098584847L;

	public JsonListType() {
		super( JsonStringSqlTypeDescriptor.INSTANCE, new JsonListTypeDescriptor());
	}

	public String getName() {
		return "json";
	}

	@Override
	protected boolean registerUnderJavaType() {
		return true;
	}

	@Override
	public void setParameterValues(Properties parameters) {
		((JsonListTypeDescriptor) getJavaTypeDescriptor()).setParameterValues(parameters);
	}

}
